home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / resocd / res_2.frm < prev    next >
Text File  |  1995-05-08  |  8KB  |  242 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    BackColor       =   &H0000FFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Resource Bar"
  6.    ClientHeight    =   3360
  7.    ClientLeft      =   3045
  8.    ClientTop       =   1245
  9.    ClientWidth     =   2655
  10.    Height          =   3765
  11.    Left            =   2985
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3360
  17.    ScaleWidth      =   2655
  18.    Top             =   900
  19.    Width           =   2775
  20.    Begin SSPanel Panel3D1 
  21.       BackColor       =   &H00C0C0C0&
  22.       BevelInner      =   1  'Inset
  23.       BevelOuter      =   1  'Inset
  24.       BevelWidth      =   3
  25.       BorderWidth     =   4
  26.       Font3D          =   0  'None
  27.       ForeColor       =   &H00000000&
  28.       Height          =   3375
  29.       Left            =   0
  30.       TabIndex        =   0
  31.       Top             =   0
  32.       Width           =   2655
  33.       Begin SSCommand OkButton 
  34.          BevelWidth      =   5
  35.          Caption         =   "Ok"
  36.          Font3D          =   2  'Raised w/heavy shading
  37.          ForeColor       =   &H00000000&
  38.          Height          =   495
  39.          Left            =   1560
  40.          TabIndex        =   9
  41.          Top             =   2640
  42.          Width           =   735
  43.       End
  44.       Begin SSCommand HelpButton 
  45.          BevelWidth      =   5
  46.          Caption         =   "Help"
  47.          Font3D          =   2  'Raised w/heavy shading
  48.          ForeColor       =   &H00000000&
  49.          Height          =   495
  50.          Left            =   360
  51.          TabIndex        =   1
  52.          Top             =   2640
  53.          Width           =   735
  54.       End
  55.       Begin SSFrame Frame3D2 
  56.          Caption         =   "Bottom Of The Hour"
  57.          Font3D          =   2  'Raised w/heavy shading
  58.          ForeColor       =   &H00C00000&
  59.          Height          =   855
  60.          Left            =   240
  61.          TabIndex        =   6
  62.          Top             =   1680
  63.          Width           =   2175
  64.          Begin SSOption Ding 
  65.             Caption         =   "None"
  66.             Font3D          =   4  'Inset w/heavy shading
  67.             ForeColor       =   &H00000000&
  68.             Height          =   255
  69.             Index           =   1
  70.             Left            =   120
  71.             TabIndex        =   8
  72.             TabStop         =   0   'False
  73.             Top             =   480
  74.             Width           =   1695
  75.          End
  76.          Begin SSOption Ding 
  77.             Caption         =   "Ding"
  78.             Font3D          =   4  'Inset w/heavy shading
  79.             ForeColor       =   &H00000000&
  80.             Height          =   255
  81.             Index           =   0
  82.             Left            =   120
  83.             TabIndex        =   7
  84.             Top             =   240
  85.             Value           =   -1  'True
  86.             Width           =   1695
  87.          End
  88.       End
  89.       Begin SSFrame Frame3D1 
  90.          Caption         =   "Top Of The Hour"
  91.          Font3D          =   2  'Raised w/heavy shading
  92.          ForeColor       =   &H00C00000&
  93.          Height          =   1335
  94.          Left            =   240
  95.          TabIndex        =   2
  96.          Top             =   240
  97.          Width           =   2175
  98.          Begin SSOption BigBen 
  99.             Caption         =   "None"
  100.             Font3D          =   4  'Inset w/heavy shading
  101.             ForeColor       =   &H00000000&
  102.             Height          =   255
  103.             Index           =   2
  104.             Left            =   120
  105.             TabIndex        =   5
  106.             TabStop         =   0   'False
  107.             Top             =   960
  108.             Width           =   1455
  109.          End
  110.          Begin SSOption BigBen 
  111.             Caption         =   "Ding"
  112.             Font3D          =   4  'Inset w/heavy shading
  113.             ForeColor       =   &H00000000&
  114.             Height          =   255
  115.             Index           =   1
  116.             Left            =   120
  117.             TabIndex        =   4
  118.             TabStop         =   0   'False
  119.             Top             =   600
  120.             Width           =   1455
  121.          End
  122.          Begin SSOption BigBen 
  123.             Caption         =   "Big Ben"
  124.             Font3D          =   4  'Inset w/heavy shading
  125.             ForeColor       =   &H00000000&
  126.             Height          =   255
  127.             Index           =   0
  128.             Left            =   120
  129.             TabIndex        =   3
  130.             Top             =   240
  131.             Value           =   -1  'True
  132.             Width           =   1455
  133.          End
  134.       End
  135.    End
  136. End
  137. Sub BigBen_Click (Index As Integer, Value As Integer)
  138. If BigBen(0).Value = True Then NewTopOfHour$ = "BIGBEN"
  139. If BigBen(1).Value = True Then NewTopOfHour$ = "DING"
  140. If BigBen(2).Value = True Then NewTopOfHour$ = "NONE"
  141. End Sub
  142.  
  143. Sub Command3D1_Click ()
  144. Unload Form2
  145. Call Help_Me
  146.  
  147. End Sub
  148.  
  149. Sub DING_Click (Index As Integer, Value As Integer)
  150. If DING(0).Value = True Then NewBottOfHour$ = "DING"
  151. If DING(1).Value = True Then NewBottOfHour$ = "NONE"
  152. End Sub
  153.  
  154. Sub Form_Load ()
  155.  
  156.  
  157. 'Take away the ON TOP feature in case user has
  158. ' positioned "bar" in front of where the form will appear
  159. ' Then reinstate the ON TOP feature in the Form_Unload
  160. ' proceedure.
  161.     NotOnTop% = SetWindowPos(Form1.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
  162.  
  163. 'read .ini file in case user changed
  164. ' it manually
  165.  'Does user want BigBen,DING, or nothing at top of hour
  166. AppName$ = "RESOURCE BAR"
  167. KeyName$ = "TOPOFHOUR"
  168. DefltStr$ = "BIGBEN"
  169. Dim RetStr As String * 255
  170. RetStr$ = String$(255, 0)
  171. nSize% = 255
  172. FileName$ = "RESOURCE.INI"
  173. LngthOfRetStr% = GetPrivateProfileString(AppName$, KeyName$, DefltStr$, RetStr$, nSize%, FileName$)
  174. TopOfHour$ = UCase$(Left$(RetStr$, LngthOfRetStr%))
  175.  
  176.  'Does user want DING or nothing at bottom of hour
  177. AppName$ = "RESOURCE BAR"
  178. KeyName$ = "BOTTOFHOUR"
  179. DefltStr$ = "DING"
  180. RetStr$ = String$(255, 0)
  181. nSize% = 255
  182. FileName$ = "RESOURCE.INI"
  183. LngthOfRetStr% = GetPrivateProfileString(AppName$, KeyName$, DefltStr$, RetStr$, nSize%, FileName$)
  184. BottOfHour$ = UCase$(Left$(RetStr$, LngthOfRetStr%))
  185.  
  186. If TopOfHour$ = "BIGBEN" Then BigBen(0).Value = True
  187. If TopOfHour$ = "DING" Then BigBen(1).Value = True
  188. If TopOfHour$ = "NONE" Then BigBen(2).Value = True
  189. If BottOfHour$ = "DING" Then DING(0).Value = True
  190. If BottOfHour$ = "NONE" Then DING(1).Value = True
  191.  
  192.  
  193. End Sub
  194.  
  195. Sub Form_Unload (Cancel As Integer)
  196.  
  197. AppName$ = "RESOURCE BAR"
  198. KeyName$ = "BOTTOFHOUR"
  199. FileName$ = "RESOURCE.INI"
  200. If NewBottOfHour$ <> BottOfHour$ Then 'if Option changed, rewrite INI file
  201.         BottOfHour$ = NewBottOfHour$
  202.         NewVal$ = BottOfHour$
  203. ResultCode% = WritePrivateProfileString(AppName$, KeyName$, NewVal$, FileName$)
  204.  
  205.     If ResultCode% = 0 Then
  206.             MsgBox "Error updating INI file!", 16, "ERROR!"
  207.     End If
  208.  
  209. End If
  210.  
  211. 'now check top of the hour setting
  212. AppName$ = "RESOURCE BAR"
  213. KeyName$ = "TOPOFHOUR"
  214. FileName$ = "RESOURCE.INI"
  215. If NewTopOfHour$ <> TopOfHour$ Then 'if Option changed, rewrite INI file
  216.         TopOfHour$ = NewTopOfHour$
  217.         NewVal$ = TopOfHour$
  218. ResultCode% = WritePrivateProfileString(AppName$, KeyName$, NewVal$, FileName$)
  219.  
  220.     If ResultCode% = 0 Then
  221.             MsgBox "Error updating INI file!", 16, "ERROR!"
  222.     End If
  223.  
  224. End If
  225.  
  226.  
  227. Unload Form2
  228.  
  229. OnTop% = SetWindowPos(Form1.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  230.  
  231. End Sub
  232.  
  233. Sub HelpButton_Click ()
  234. Unload Form2
  235. Call Help_Me
  236. End Sub
  237.  
  238. Sub OkButton_Click ()
  239. Call Form_Unload(0)
  240. End Sub
  241.  
  242.